1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#![allow(non_camel_case_types, non_snake_case)]

use crate::decl::*;
use crate::kernel::ffi_types::*;
use crate::prelude::*;
use crate::vt::*;

/// [`IExecAction`](crate::IExecAction) virtual table.
#[repr(C)]
pub struct IExecActionVT {
	pub IAction: IActionVT,
	pub get_Path: fn(COMPTR, *mut PSTR) -> HRES,
	pub put_Path: fn(COMPTR, PCSTR) -> HRES,
	pub get_Arguments: fn(COMPTR, *mut PSTR) -> HRES,
	pub put_Arguments: fn(COMPTR, PCSTR) -> HRES,
	pub get_WorkingDirectory: fn(COMPTR, *mut PSTR) -> HRES,
	pub put_WorkingDirectory: fn(COMPTR, PCSTR) -> HRES,
}

com_interface! { IExecAction: "4c3d624d-fd6b-49a3-b9b7-09cb3cd3f047";
	/// [`IExecAction`](https://learn.microsoft.com/en-us/windows/win32/api/taskschd/nn-taskschd-iexecaction)
	/// COM interface over [`IExecActionVT`](crate::vt::IExecActionVT).
	///
	/// Automatically calls
	/// [`Release`](https://learn.microsoft.com/en-us/windows/win32/api/unknwn/nf-unknwn-iunknown-release)
	/// when the object goes out of scope.
	///
	/// # Examples
	///
	/// ```no_run
	/// use winsafe::{self as w, prelude::*};
	///
	/// let action: w::IAction; // initialized somewhere
	/// # let action = unsafe { w::IAction::null() };
	///
	/// let exec_action = action
	///     .QueryInterface::<w::IExecAction>()?;
	/// # w::HrResult::Ok(())
	/// ```
}

impl oleaut_IDispatch for IExecAction {}
impl taskschd_IAction for IExecAction {}
impl taskschd_IExecAction for IExecAction {}

/// This trait is enabled with the `taskschd` feature, and provides methods for
/// [`IExecAction`](crate::IExecAction).
///
/// Prefer importing this trait through the prelude:
///
/// ```no_run
/// use winsafe::prelude::*;
/// ```
pub trait taskschd_IExecAction: taskschd_IAction {
	fn_com_bstr_get! { get_Arguments: IExecActionVT;
		/// [`IExecAction::get_Arguments`](https://learn.microsoft.com/en-us/windows/win32/api/taskschd/nf-taskschd-iexecaction-get_arguments)
		/// method.
	}

	fn_com_bstr_get! { get_Path: IExecActionVT;
		/// [`IExecAction::get_Path`](https://learn.microsoft.com/en-us/windows/win32/api/taskschd/nf-taskschd-iexecaction-get_path)
		/// method.
	}

	fn_com_bstr_get! { get_WorkingDirectory: IExecActionVT;
		/// [`IExecAction::get_WorkingDirectory`](https://learn.microsoft.com/en-us/windows/win32/api/taskschd/nf-taskschd-iexecaction-get_workingdirectory)
		/// method.
	}

	fn_com_bstr_set! { put_Arguments: IExecActionVT, arguments;
		/// [`IExecAction::get_Arguments`](https://learn.microsoft.com/en-us/windows/win32/api/taskschd/nf-taskschd-iexecaction-put_arguments)
		/// method.
	}

	fn_com_bstr_set! { put_Path: IExecActionVT, path;
		/// [`IExecAction::put_Path`](https://learn.microsoft.com/en-us/windows/win32/api/taskschd/nf-taskschd-iexecaction-put_path)
		/// method.
	}

	fn_com_bstr_set! { put_WorkingDirectory: IExecActionVT, working_directory;
		/// [`IExecAction::put_WorkingDirectory`](https://learn.microsoft.com/en-us/windows/win32/api/taskschd/nf-taskschd-iexecaction-put_workingdirectory)
		/// method.
	}
}